name: Go

on:
  push:
    branches: ["develop"]
  pull_request:
    branches: ["main"]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Set up Go
        uses: actions/setup-go@v4
        with:
          go-version: "1.22.1"
      - name: GolangCI-Linter
        # You may pin to the exact commit or the version.
        # uses: Mushus/golangci-linter@931bc5ccc973f10640a0feff55d49b12eddfa354
        uses: Mushus/golangci-linter@v1.1.2
        with:
          # Path of the GolangCI-Lint config file
          config: .golangci.yml
          # Path of the Golang project root directory
          basePath: .

      - name: Build
        run: go build -v ./...

      - name: Test
        run: go test -v -race --timeout=30s ./...
